// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require('fs')
function promisify(readFile: any) {
  return function (filename: any, encoding: any) {
    return new PromiseX(function (resolve, reject) {
      readFile(filename, encoding, function (err: any, data: any) {
        if (err)
          reject(err)
        else
          resolve(data)
      })
    })
  }
}
// @ts-ignore
const readFile = promisify(fs.readFile)

(async function () {
  const content = await readFile('./1.txt', 'utf8')
  console.log(content)
})()
